home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / sweettim.swf / scripts / frame_8 / PlaceObject2_218_197 / CLIPACTIONRECORD onClipEvent(load).as < prev   
Encoding:
Text File  |  2011-06-09  |  1.2 KB  |  51 lines

  1. onClipEvent(load){
  2.    function updateSpeechBubble(sweetType)
  3.    {
  4.       _root.mcInterface.holding.gotoAndStop(sweetType);
  5.    }
  6.    function updateTimerText()
  7.    {
  8.       tempMins = Math.floor(_root.timer / 60);
  9.       tempSeconds = _root.timer - tempMins * 60;
  10.       if(tempMins == 0 && tempSeconds == 0)
  11.       {
  12.          _root.endGame();
  13.       }
  14.       else
  15.       {
  16.          if(tempSeconds < 10)
  17.          {
  18.             tempSeconds = "0" + tempSeconds;
  19.          }
  20.          _root.mcInterface.time.text = tempMins + ":" + tempSeconds;
  21.       }
  22.    }
  23.    function updateScoreText(valueGained)
  24.    {
  25.       if(!(_root.currentScore == 0 && valueGained < 0))
  26.       {
  27.          _root.currentScore += valueGained;
  28.       }
  29.       if(_root.currentScore > 0)
  30.       {
  31.          tempPound = Math.floor(_root.currentScore / 100);
  32.          if(tempPound < 10)
  33.          {
  34.             tempPound = "0" + tempPound;
  35.          }
  36.          tempPenny = _root.currentScore - tempPound * 100;
  37.          if(tempPenny < 10)
  38.          {
  39.             tempPenny = "0" + tempPenny;
  40.          }
  41.       }
  42.       else
  43.       {
  44.          tempPound = "00";
  45.          tempPenny = "00";
  46.       }
  47.       _root.mcInterface.score.text = tempPound + "." + tempPenny;
  48.    }
  49.    count = 0;
  50. }
  51.